/*
 * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙，一起邂逅框架梦]
 * 
 * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_account.htm
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.zhiqim.account;

import org.zhiqim.kernel.constants.ZhiqimConstants;
import org.zhiqim.kernel.util.codes.SHA256;

/**
 * 账号密码器
 *
 * @version v1.0.0 @author zouzhigang 2017-6-28 新建与整理
 */
public class ZacPassworder implements ZhiqimConstants
{
    /**
     * 操作员密码不可逆编码，默认SHA256(name + code + pass + salt)
     * 
     * @param userId        用户编号
     * @param userPass      用户密码
     * @param userPassSalt  用户密码盐值
     * @return              编码之后的密码
     */
    public static String encode(long userId, String userPass, String userPassSalt)
    {
        return SHA256.encodeUTF8(userId + userPass + userPassSalt);
    }
}
